package br.gov.pe.seres.siap.view.managedBean.NOME_PACKAGE;

import javax.inject.Named;
import br.gov.frameworkdemoiselle.annotation.ViewScoped;
import br.gov.frameworkdemoiselle.security.RequiredRole;
import br.gov.frameworkdemoiselle.stereotype.ViewController;
import br.gov.pe.seres.siap.bean.NOME_POJO;
import br.gov.pe.seres.siap.constant.AliasNavigationRules;
import br.gov.pe.seres.siap.view.managedBean.SiapEditBean;

@ViewController
@ViewScoped
@Named("NOME_ATRIBUTO_BEANEditMB")
public class NOME_POJOEditMB extends SiapEditBean<NOME_POJO> {

	@Override
	@RequiredRole("NOME_POJO.alterar")
	public String alterar() {
		getFachada().alterarNOME_POJO(getBean(), getUsuarioLogado());
		return this.getAliasPaginaConsulta();
	}

	@Override
	protected NOME_POJO buscarEntidade() {
		return getFachada().buscarNOME_POJO(getId());
	}

	@Override
	@RequiredRole("NOME_POJO.excluir")
	public String excluir() {
		getFachada().removerNOME_POJO(getBean(), getUsuarioLogado());
		return this.getAliasPaginaConsulta();
	}

	@Override
	protected String getAliasPaginaConsulta() {
		return AliasNavigationRules.#ALIAS#_CONSULTA;
	}

	@Override
	protected String getAliasPaginaEdicao() {
		return AliasNavigationRules.#ALIAS#_EDICAO;
	}

	@Override
	@RequiredRole("NOME_POJO.incluir")
	public String inserir() {
		getFachada().inserirNOME_POJO(getBean(), getUsuarioLogado());
		return this.getAliasPaginaConsulta();
	}

}
